package com.anlogic.sdk.app.model;

import org.eclipse.core.resources.IProject;

import com.anlogic.sdk.bsp.model.IPlatformProject;
import com.anlogic.sdk.utils.options.BitWidth;
import com.anlogic.sdk.utils.options.LanguageType;
import com.anlogic.sdk.utils.options.OsType;

public class ApplicationModel {
	private String projName;

	private String projLoc;

	private String chip;
	
	private String proc;

	private String os = OsType.Standalone.getName();

	private String lang = LanguageType.C.getName();

	private String bitWidth = BitWidth.BIT64.getName();
	
	private String bspName = "";

	private String appName;
	
	private boolean managedBuildOn = false;
	
	private boolean isFsbl = false;
	
	IPlatformProject platProject;

	public void setPlatform(IPlatformProject platProject) {
		this.platProject = platProject;
		this.bspName = platProject.getName();
		this.chip = platProject.getChip();
		this.proc = platProject.getProcessor();
		this.os = platProject.getOs();
	}
	
	public IPlatformProject getPlatform() {
		return this.platProject;
	}
	
	public IProject getPlatformProject() {
		if (this.platProject == null) {
			return null;
		}
		return this.platProject.getIProject();
	}
	
	public String getProjName() {
		return this.projName;
	}

	public void setProjName(String projName) {
		this.projName = projName;
	}

	public String getProjLoc() {
		return this.projLoc;
	}

	public void setProjLoc(String projLoc) {
		this.projLoc = projLoc;
	}
	
	public String getBspLoc() {
		if (this.platProject == null) {
			return null;
		}
		return this.platProject.getLoc();
	}

	public String getChip() {
		return this.chip;
	}

	public void setChip(String chip) {
		this.chip = chip;
	}
	
	public String getProc() {
		return this.proc;
	}

	public void setProc(String proc) {
		this.proc = proc;
	}

	public String getOs() {
		return this.os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public String getLang() {
		return this.lang;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}
	
	public String getBitWidth() {
		return this.bitWidth;
	}

	public void setBitWidth(String bitWidth) {
		this.bitWidth = bitWidth;
	}

	public String getBspName() {
		return this.bspName;
	}

	public void setBspName(String bspName) {
		this.bspName = bspName;
	}

	public String getAppName() {
		return this.appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}
	
	public boolean getManagedBuildOn() {
		return this.managedBuildOn;
	}
	
	public void setManagedBuildOn(boolean managedBuildOn) {
		this.managedBuildOn = managedBuildOn;
	}
	
	public boolean getIsFsbl() {
		return this.isFsbl;
	}
	
	public void getIsFsbl(boolean isFsbl) {
		this.isFsbl = isFsbl;
	}
}
